package user;

import book.BookList;
import operation.IOperation;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-02-10
 * Time: 17:06
 */

public  abstract class User {
    //使用者姓名
    protected String name;
    //创建使用者操作数组，数组中存储相关操作的功能
    protected IOperation[] operations;

    public User(String name) {
        this.name = name;
    }
    //子类继承父类的方法，打印菜单
    public abstract int Menu();

    //根据用户选项，执行对应的操作
    public void doWork(int choice, BookList bookList){
        operations[choice].work(bookList);
    }
}
